﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace MLY.LTR
{
    public partial class MessagesWindow : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {            
                Repeater1.DataSource = GetData();
                Repeater1.DataBind();              
        }

        
        public List<Bll.clsMessageForOrg> GetData()
        {

            if (Session["OrganizationId"] != null)
            {
                return Bll.clsMessageForOrg.GetMessages(int.Parse(Session["OrganizationId"].ToString()));
            }
            else return null;
        }
        public void BindData(int OrgId)
        {
            Repeater1.DataSource = Bll.clsMessageForOrg.GetMessages(int.Parse(Session["OrganizationId"].ToString()));
            Repeater1.DataBind(); 
        }

        protected void btnMsg_Click(object sender, EventArgs e)
        {
            Response.RedirectTo("~/LTR/Messages.aspx");
        }

       
    }
}